<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!-- 引入meta文件 -->
<%@include file="/WEB-INF/pages/common/meta.jspf"%>

<!-- 引入header文件 -->
<%@include file="/WEB-INF/pages/common/header.jspf"%>

<!-- 引入menu文件 -->
<%@include file="/WEB-INF/pages/common/menu.jspf"%>



<section class="Hui-article-box"><nav class="breadcrumb"><i class="Hui-iconfont"></i> 首页 <span class="c-gray en">&gt;</span> 课程管理<span class="c-gray en">&gt;</span> 课程列表<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a></nav>
<div class="Hui-article">
	<article class="cl pd-20">
	<div class="text-c">
		 查询条件：
		<input type="text" class="input-text" style="width:250px" placeholder="课程编号、课程名称" id="teacherKeyWord" name="">
		<button type="submit" class="btn btn-success radius" id="teacherSearchBin" name=""><i class="Hui-iconfont"></i> 搜索</button>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l"><a href="javascript:;" id="teacherAddBin" class="btn btn-primary radius"><i class="Hui-iconfont"></i> 添加课程</a></span><span class="r">共有数据：<strong id="teacherTotalRows">0</strong> 条</span>
	</div>
	<div class="mt-20">
		<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
			
			
			<table class="table table-border table-bordered table-hover table-bg table-sort dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
			<thead>
			<tr class="text-c" role="row">
				<th width="25" class="sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 25px;">
					<input type="checkbox" name="" value="">
				</th>
				<th width="80" class="sorting_desc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="descending" aria-label="ID: 升序排列" style="width: 80px;">
					学生编号
				</th>
				<th width="100" class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="用户名: 升序排列" style="width: 100px;">
					学生名称
				</th>
				<th width="100" class="sorting_disabled" rowspan="1" colspan="1" aria-label="操作" style="width: 100px;">
					操作
				</th>
			</tr>
			</thead>
			<tbody id="teacherTbody">
			
			</tbody>
			</table>
			<div class="dataTables_info" id="DataTables_Table_0_info" role="status" aria-live="polite">
				显示 <span id="teacherStartRowId">0</span> 到 <span id="teacherEndRow">0</span> ，共 <span id="teacherLimitId">0</span> 条
			</div>
			<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
				<a class="paginate_button previous disabled" aria-controls="DataTables_Table_0" data-dt-idx="0" tabindex="0" id="teacherPrvePageId">上一页</a><span><a class="paginate_button current" aria-controls="DataTables_Table_0" data-dt-idx="1" tabindex="0" id="teacherCurrentPageId">1</a></span><a class="paginate_button next disabled" aria-controls="DataTables_Table_0" data-dt-idx="2" tabindex="0" id="teacherNextPageId">下一页</a>
			</div>
		</div>
	</div>
	</article>
</div>
</section>

<!-- 引入footer文件 -->
<%@include file="/WEB-INF/pages/common/footer.jspf"%>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
function reloadParent(){
	location.reload();
}
function eidt(id){
	var that=this;
	layer.open({
		title:'修改老师',
		type:2,
		shadeClose:true,
		area:['30%','40%'],
		content:"${basePath}/teacher/edit?tId="+id,
		scrollbar :true
	});
}
$(function(){
	//回调渲染模板
	function reload(data){
		if(data!=null && data.length>0){
			var tbodyHtml="";	
			for(var i=0;i<data.length;i++){
				tbodyHtml+='<tr class="text-c odd" role="row">';
						tbodyHtml+='<td>';
							tbodyHtml+='<input type="checkbox" value="1" name="">';
						tbodyHtml+='</td>';
						tbodyHtml+='<td>';
						tbodyHtml+=data[i].tId;
						tbodyHtml+='</td>';
						tbodyHtml+='<td>';
						tbodyHtml+=data[i].tName;
						tbodyHtml+='</td>';
						tbodyHtml+='<td class="td-manage">';
							tbodyHtml+='<a title="编辑" href="javascript:eidt(\''+data[i].tId+'\');" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>';
						tbodyHtml+='</td>';
						tbodyHtml+='</tr>';
			}
		}
		$("#teacherTbody").html(tbodyHtml);
	}
	
	var entity=new Entity({
		selectUrl:"/teacher/list",
		addUrl:"/teacher/add",
		deleteUrl:"/teacher/delete",
		updateUrl:"/teacher/update",
		keyWord:"#teacherKeyWord",
		searchBin:"#teacherSearchBin",
		addBin:"#teacherAddBin",
		totalRowsId:"#teacherTotalRows",
		currentPageId:"#teacherCurrentPageId",
		startRowId:"#teacherStartRowId",
		endRowId:"#teacherEndRow",
		limitId:"#teacherLimitId",
		prvePageId:"#teacherPrvePageId",
		nextPageId:"#teacherNextPageId",
		reload:reload
	});
	
	//查询列表
	entity.select();
	entity.bindEvent();
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>